import request from '@/api/index.js'

// 注册
export const registerAPI = (data) => {
	return request({
		url: '/applet/reception/appletUser/register',
		method: 'post',
		data 
	})
}

// 登录
export const loginAPI = (data) => {
	return request({
		url: '/applet/reception/appletUser/login',
		method: 'post',
		data 
	})
}

// 退出登录
export const logoutAPI = () => {
	return request({
		url: '/applet/reception/appletUser/logout',
		method: 'delete'
	})
}

// 获取用户信息
export const getUserInfo = (userId) => {
	return request({
		url: `/applet/reception/appletUser/myself/myselfData/${userId}`
	})
}

// 修改密码 userId currentPassword newPassword
export const setUserPassward = (data) => {
	return request({
		url: '/applet/reception/appletUser/myself/updateUserPassword',
		method: 'post',
		data
	})
}

// 修改用户基本信息
export const updateUserBasicAPI= (data) => {
	return request({
		url: '/applet/reception/appletUser/myself/updateUserBasic',
		method: 'post',
		data
	})
}